<%--
  Created by IntelliJ IDEA.
  User: 27236
  Date: 2021/8/20
  Time: 18:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<!-- 网页使用的语言 -->
<html lang="zh-CN">
<head>
  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <title>诚信考试</title>
  <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet">
  <script src="${pageContext.request.contextPath}/static/js/jquery-3.6.0.js"></script>
  <script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container" style="width: 1200px">
  <h3 style="text-align: center">班级管理</h3>
  <div style="float: right;margin: 5px">
    <a class="btn btn-primary" href="${pageContext.request.contextPath}/jsp/teacher/main.jsp">返回</a>
  </div>
  <table border="1" class="table table-bordered table-hover">
    <tr class="success">
      <th>序号</th>
      <th>学生姓名</th>
      <th>考试时间</th>
      <th>考试时长</th>
      <th>完成情况</th>
      <th>分数</th>
      <th>操作</th>
    </tr>

    <c:forEach items="${studentList}" var="stu" varStatus="s">
      <tr>
        <td>${s.count}</td>
        <td>${stu.username}</td>
        <c:forEach items="${gradeList}" var="grade">
          <c:if test="${grade.studentId==stu.id}">
            <td>${grade.beginTime}</td>
            <td>${grade.useTime}</td>
            <c:if test="${grade.type==0}">
              <td>未开始</td>
            </c:if>
            <c:if test="${grade.type==1}">
              <td>已考试</td>
            </c:if>
            <c:if test="${grade.type==2}">
              <td>弃考</td>
            </c:if>
            <td>${grade.score}</td>
          </c:if>
          <c:if test="${grade.studentId!=stu.id}">
            <td></td>
            <td>0</td>
            <td>未开始</td>
            <td>0</td>
          </c:if>
        <td>
          <c:if test="${grade.type==1}">
            <a class="btn btn-default btn-sm" href="${pageContext.request.contextPath}/Test/markExam/${grade.id}/${stu.id}">批改试卷</a>
          </c:if>
            <a class="btn btn-default btn-sm" href="${pageContext.request.contextPath}/Teacher/getExam/${grade.id}/${grade.test.id}">试卷详情</a>
        </td>
        </c:forEach>
        &nbsp;
      </tr>
    </c:forEach>

  </table>
</div>
</body>
</html>
